<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<link href="<?php echo $this->baseUrl;?>/admincss/style.css" rel="stylesheet" type="text/css" />
<script charset="utf-8" src="<?php echo $this->baseUrl;?>/adminjs/kindeditor-min.js"></script>
<script charset="utf-8" src="<?php echo $this->baseUrl;?>/adminjs/lang/zh_CN.js"></script>
<script>
var editor;
KindEditor.ready(function(K) {
        editor = K.create('#content', {
		uploadJson : '<?php echo $this->url ($this->baseUrl, "article", "upload", "", "admin");?>',
		fileManagerJson : '<?php echo $this->url ($this->baseUrl, "article", "filemanage", "", "admin");?>',
		allowFileManager : true
        });
});
</script>
<body>
<form id="form1" name="form1" method="post" enctype="multipart/form-data" action="<?php echo $this->url ($this->baseUrl, "tpxw", "doedit", "", "admin");?>">
<input type="hidden" name="aid" value="<?php echo $this->content['aid'];?>" />
<input type="hidden" name="nowp" value="<?php echo $this->nowp;?>" />
<input type="hidden" name="type" value="<?php echo $this->type;?>" />

  <table width="100%" border="1" class="tableA" >
    <tr>
      <td colspan="3" align="center">编辑图片新闻</td>
    </tr>
    <tr>
      <td width="14%">文章分类</td>
      <td width="26%">
        <select name="cid" id="cid">
          <?php echo $this->option;?>
      </select></td>
      <td width="60%">&nbsp;</td>
    </tr>
    <tr>
      <td>标题</td>
      <td><label for="title"></label>
      <input name="title" type="text" id="title" size="50" value="<?php echo htmlspecialchars($this->content['title']);?>" /></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>链接地址</td>
      <td>
      <input name="subtitle" type="text" id="subtitle" size="50" value="<?php echo htmlspecialchars($this->content['subtitle']);?>"/></td>
      <td>可以为空</td>
    </tr>
        <tr>
      <td>图片</td>
      <td nowrap><input name="image" type="file" id="image" size="30" onchange="javascript:return fileCheck();" />
      <?php if (!empty($this->content['image'])) echo '<input type="checkbox" value="1" name="delimage" />删除图片<a href="' . $this->baseUrl . $this->content['image'] . '" target=_blank><img height=50 width=50 src="' . $this->baseUrl . $this->content['image'] . '"></a>'?>
      </td>
      <td>图片新闻的图片，大小 940 * 260</td>
    </tr>
    <tr>
      <td>排序</td>
      <td><input name="seq" type="text" id="seq" size="10" value="<?php echo($this->content['seq']);?>"/>&nbsp;<label for="top">置顶</label><input id="top" type="checkbox" value="1" name="top" /></td>
      <td>从大到小排序</td>
    </tr>
    <tr>
      <td colspan="3" align="center"><input type="submit" name="button" id="button" value="提交" class="btn_submit"/>
      <input class="btn_submit" type="button" name="button" id="button" onclick="javascript:history.back(-1);" value="返回" /></td>
    </tr>
  </table>
</form>
</body>
</html>
<script>
/**
 * 对所选择的文件类型加以判断
 */
function fileCheck(){
  var postfix = form1.image.value.match(/^(.*)(\.)(.{1,8})$/)[3].toLowerCase(); //获得选择的上传文件的后缀名的正则表达式
  if(!(postfix == "jpg"||postfix == "png"||postfix == "gif")) 
   { 
     alert('文件类型不正确，请选择jpg、png、gif文件 ！'); 
     var nf = form1.image.cloneNode(true); 
       nf.value=''; 
       form1.image.parentNode.replaceChild(nf, form1.image); 
     return false; 
   } 
}
</script>